<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
    <title>服装产业链上下游注册</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <script type="text/javascript" src="/h5/newall/newall.js"></script>
    <link rel="stylesheet" type="text/css" href="/h5/newall/newall.css">
</head>

<div class="mui-content-padded H5body">
    <MCform id="Form"
            class="mctag">
        <MCtitle class="mctag">服装产业链上下游注册</MCtitle>
        <div class="content">
            <h5 class="title">选择身份</h5>
            <ul class="btnul">
                <li class="li clickli" dataid="101">
                    <div class="btnDiv">
                        <a class="btntext "><i class="icoFile icoFill1"></i>我是公司</a>
                        <i class="icoFile icoduihao"></i>
                    </div>
                    <p class="desc">自己没有工厂，全部外发生产</p>
                </li>
                <li class="li clickli" dataid="102">
                    <div class="btnDiv">
                        <a class="btntext"><i class="icoFile icoFill2"></i>我是工厂</a>
                        <i class="icoFile icoduihao"></i>
                    </div>
                    <p class="desc">纯加工厂，没有自己品牌</p>
                </li>
                <li class="li clickli" dataid="103">
                    <div class="btnDiv">
                        <a class="btntext"><i class="icoFile icoFill3"></i>我要应聘</a>
                        <i class="icoFile icoduihao"></i>
                    </div>
                    <p class="desc">服装产业上下游员工或者找工作</p>
                </li>
                <li class="li jieshaorenLi">
                    <div class="btnDiv">
                        <span class="sp86">+86</span>
                        <input type="number" class="phone" placeholder="介绍人手机号码"/>
                    </div>
                </li>
            </ul>
            <p class="xieyi">点击下一步代表你已阅读同意<a href="/h5/ios/userNotice.html" class="l">服务协议</a>和<a class="l"
                                                                                                  href="/h5/ios/userNotice.html">隐私政策</a>
            </p>
            <button id="submit" type="button"
                    class="mui-btn mui-btn-primary" disabled="disabled" style="width:100%;
                    margin: 15px auto; display: block;">
                下一步
            </button>


        </div>
    </MCform>
</div>

<script type="text/javascript" src="/h5/js/all2.js"></script>
</body>
<style>
    .content {
        width: 90%;
        margin: 0 auto;
        position: relative;
        padding-top: 0.5rem;
    }

    .content .title {
        font-size: .18rem;
        color: rgba(102, 108, 115, 1);
        line-height: .2rem;
    }

    .btnul {
        margin-top: 0.2rem;
    }

    .btnul .li {
        width: 100%;
        position: relative;
    }

    .btnul .li .btnDiv .btntext {
        font-size: .16rem;
        font-weight: 500;
        color: rgba(96, 102, 110, 1);
        line-height: 0.22rem;
        position: relative;
    }

    .btntext .icoFile {
        top: 0rem;
        left: -0.3rem;
        position: absolute;
    }

    .btnul .li .desc {
        font-size: .12rem;
        font-weight: 500;
        color: rgba(138, 145, 153, 1);
        line-height: 0.1rem;
        text-align: center;
        margin-top: 0.1rem;
        margin-bottom: 0.25rem;
    }

    .btnul .li .btnDiv {
        background: rgba(255, 255, 255, 1);
        border-radius: 4px;
        border: 1px solid rgba(223, 224, 227, 1);
        width: 100%;
        height: 0.51rem;
        margin: 0 auto;
        line-height: 0.51rem;
        text-align: center;
        position: relative;
    }

    .jieshaorenLi {
        margin-top: .8rem;
    }

    .btnul .li .btnDiv .sp86 {
        position: absolute;
        left: 0rem;
        top: 0rem;
        width: 0.5rem;
    }

    .btnul .li .btnDiv .phone {
        position: absolute;
        left: 0.5rem;
        top: 0.01rem;
        width: 2.8rem;
        border: 0;
        border-left: 1px silver solid;
        padding: 0;
        margin: 0;
        height: 0.48rem;
        padding-left: 0.1rem;
    }

    .xieyi {
        text-align: center;
        font-size: .12rem;
        margin-top: 0.3rem;
    }

    .xieyi .l {
        color: #15A1FFFF;
    }

    .btnDiv .icoduihao {
        position: absolute;
        right: 0.3rem;
        top: 0.15rem;
        display: none;
    }

    .clickli.on .icoduihao {
        display: block;
    }

    .clickli.on .btnDiv {
        border: 1px solid rgba(21, 161, 255, 1);
    }

    .clickli.on .btnDiv .btntext {
        color: rgba(21, 161, 255, 1);
    }


</style>
<script>
    var view = new MC.View.MCform('#Form');
    $('.btnul .clickli').on('click', function () {
        $('.btnul .clickli').removeClass('on');
        $(this).addClass('on');
        $('#submit').attr('disabled', false);
    });
    $('#submit').on('click', function () {
        var dataid = $('.btnul .clickli.on').attr('dataid');
        var introducer = $('.phone').val();
        if (introducer !== '') {
            if (!MC.test.regMobile(introducer)) {
                return;
            }
        }
        MC.apiD('setUserTypeIntroducer', {
            type: dataid,
            introducer: introducer
        }, function (data) {
            console.log(data);
            if (data == 'ok') {
                if (dataid == '101') {
                    window.open('/h5/login/baselist_gs.html', '_self');
                } else if (dataid == '102') {
                    window.open('/h5/login/baselist_gc.html', '_self');
                } else if (dataid == '103') {
                    window.open('/h5/login/baselist_gr.html', '_self');
                }
            }
        });

        //  console.log(dataid, phone);
    });



    MC.apiD('getUserTypeIntroducer',{}, function (data) {
        console.log(data);
        $('.phone').val(data.introducer);
        $('.btnul .clickli[dataid='+data.type+']').addClass('on');
    });


</script>
</body>
</html>